package org.example.springmvc;


import org.example.springmvc.dao.UserDao;
import org.example.springmvc.pojo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("test")
public class Controller {
    @Resource
    UserDao userDao;

    @GetMapping("1")
    public String test(){
        List<User> userList=userDao.getUserList();
        String info="";
        for(User u:userList){
            info+=u+"\n";
        }
        return info;
    }
}
